package com.jason.quectel.interfaces;

import com.jason.quectel.bean.Province;

import java.util.List;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

/**
 * @author：Jason
 * @date：2022/3/10 15:30
 * @email：1129847330@qq.com
 * @description:
 */
@Dao
public interface ProvinceDao {
    @Insert
    void insertProvince(Province province);

    @Delete
    void deleteProvince(Province province);

    @Update
    void updateProvince(Province province);

    @Query("select * from province")
    List<Province> queryProvince();

    @Query("select * from province where name=:name")
    List<Province> queryProvinceByName(String name);

    @Query("delete from province where name=:name")
    void deleteProvinceByName(String name);

    @Query("update province set cityCount=:cityCount where name=:name")
    void updateProvinceByName(String name, String cityCount);
}